#!/bin/sh

. /usr/share/common

PORT="/dev/ttyUSB0"

send_command() {
	printf "\xaa\x55\x43\x05\x16$1" > $PORT
}

case "$1" in
	high | on_high)
		send_command "\xff\x07\x02\x63"
		;;
	low | on_low)
		send_command "\x33\x07\x01\x97"
		;;
	off)
		send_command "\x00\x07\x01\x64"
		;;
	*)
		echo "Usage: $0 [high|low|off]"
		exit 1
		;;
esac

exit 0
